package com.xiangwushuo.support.secret

import android.content.Context
import com.lib.common.helper.api.DomainConfig
import com.xws.libc.Secret

/**
 * Copyright (C), 2018-2019, 享物说
 * FileName: SecretUtil
 * Author: anbinke
 * Date: 2019-07-05 21:12
 * Description: 获取加密的帮助信息
 * History:
 * <author> <time> <version> <desc>
 * 作者姓名 修改时间 版本号 描述
 */
class SecretUtil {

    companion object {

        private val XWS_ID = "xws32124855427BF9AA97A0F4F5B39B0866"  // 正式环境
        private val XWS_ID_TEST = "xws964A7F9D1769F3E96A9080EF120167D9" // 测试环境

        /**
         * 获取加密key
         */
        @JvmStatic
        fun getSecret(context: Context): String {
            return if (DomainConfig.getUrlEnv() == 0) Secret.getSecret(context.applicationContext) else "C8916A0D1B326DB2424791105935C3E3"
        }

        /**
         * 获取加密 APPId
         */
        @JvmStatic
        fun getAppId(): String {
            return if (DomainConfig.getUrlEnv() == 0) XWS_ID else XWS_ID_TEST
        }
    }
}